home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#49 (Oct 89)
/
THINK C Tutor Folder
/
MacTutor.c
next >
Wrap
C/C++ Source or Header
|
1989-08-12
|
1KB
|
103 lines
/* MacTutor.c */
#include <CApplication.h>
#include <CDesktop.h>
#include <CDirector.h>
#include <commands.h>
struct CTutorApp : CApplication
{
/* no instance variables */
/* instance methods */
void ITutorApp(void);
void DoCommand(long theCommand);
};
struct CTutorDir : CDirector
{
/* CDirector is an abstract class, so we must override it */
void ITutorDir(void);
};
struct CTutorWindow : CWindow
{
/* want to override close for our own nefarious purposes */
void Close();
};
extern CApplication *gApplication;
extern CDesktop *gDesktop;
void main(void)
{
gApplication = new(CTutorApp);
((CTutorApp*)gApplication)->ITutorApp();
gApplication->Run();
gApplication->Exit();
} /* main */
void CTutorApp::DoCommand(long theCommand)
{
switch (theCommand)
{
default:
inherited::DoCommand(theCommand);
break;
} /* switch */
return;
} /* CTutorApp::DoCommand */
void CTutorApp::ITutorApp()
{
CTutorDir *ourDirector;
CApplication::IApplication(4, 20000L, 2000L);
ourDirector = new(CTutorDir);
ourDirector->ITutorDir();
return;
} /* CTutorApp::ITutorApp */
void CTutorDir::ITutorDir()
{
CDirector::IDirector(gApplication);
itsWindow = (CWindow *) new(CTutorWindow);
itsWindow->IWindow(2000, FALSE, gDesktop, this);
return;
} /* CTutorDir::ITutorDir */
void CTutorWindow::Close(void)
{
inherited::Close();
gApplication->Quit();
return;
} /* CTutorWindow::Close */
/* EOF: MacTutor.c */